package com.tbit.uqbike.client.service.impl;

import com.tbit.uqbike.client.dao.core.AdAccountDao;
import com.tbit.uqbike.client.dao.core.AdvertConfigDao;
import com.tbit.uqbike.client.pojo.AdAccount;
import com.tbit.uqbike.client.pojo.newEntity.AdvertConfig;
import com.tbit.uqbike.client.service.AdAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service("adAccountService")
public class AdAccountServiceImpl implements AdAccountService {
    @Autowired
    private AdAccountDao adAccountDao;
    @Autowired
    private AdvertConfigDao advertConfigDao;

    @Override
    public List<AdAccount> getValid(Integer accountId, Integer adType, String nowTime) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("accountId", accountId);
        params.put("adType", adType);
        params.put("nowTime", nowTime);

        return adAccountDao.getValid(params);
    }

    @Override
    public List<AdvertConfig> getByAccountId(Integer accountId) {
        return advertConfigDao.getByAccountId(accountId);
    }


}  